13/04/2022

Dependency on DEIMS-SDR

ReLTER relies on the data entered into DEIMS-SDR. However sometimes there are:

  • Multiple sites with similiar names
  • Missing information
  • Sites with no boundary polygon

First example, the Kiskun region of Hungary

Query for Site Manager

# Multiple sites in the KISKUN region of Hungary
kiskun <- get_ilter_generalinfo(country_name = "Hungary",
                              site_name = "KISKUN")
# How many sites?
print(paste("In Kiskun region: ", length(kiskun$title), "sites"))
## [1] "In Kiskun region:  8 sites"

(kiskun$title)
## [1] "Kiskun Forest Reserve Sites, KISKUN LTER - Hungary"   
## [2] "VULCAN Kiskunsag, KISKUN LTER - Hungary"              
## [3] "Kiskun Restoration Experiments, KISKUN LTER - Hungary"
## [4] "Kiskun Site Network (Jedlik), KISKUN LTER - Hungary"  
## [5] "KISKUN LTER - Hungary"                                
## [6] "LTER Fulophaza Site, KISKUN LTER - Hungary"           
## [7] "Bugac-Bocsa-Orgovany Site, KISKUN LTER - Hungary"     
## [8] "Orgovany Site, KISKUN LTER - Hungary"
# Which site? Bugac-Bocsa
bugac_id <- kiskun[7,]$uri
bugac_details <- get_site_info(bugac_id,"Contacts")
(bugac_details$generalInfo.siteManager[[1]]['name'])
##          name
## 1 Gábor Ónodi

Now query for boundary

bugac_polygon <- get_site_info(bugac_id, "Boundaries")
## 
## ----
## This site does not have boundaries uploaded to DEIMS-SDR.
## Please verify in the site page: https://deims.org/609e5959-8cd8-44a0-ab42-eda521cd452a
## ----
str(bugac_polygon)
## tibble [1 × 9] (S3: tbl_df/tbl/data.frame)
##  $ title       : chr "Bugac-Bocsa-Orgovany Site, KISKUN LTER - Hungary"
##  $ uri         : chr "https://deims.org/609e5959-8cd8-44a0-ab42-eda521cd452a"
##  $ boundaries  : logi NA
##  $ geoCoord    : chr "POINT (19.5281 46.7183)"
##  $ country     :List of 1
##   ..$ : chr "Hungary"
##  $ geoElev.avg : int 112
##  $ geoElev.min : int 105
##  $ geoElev.max : int 120
##  $ geoElev.unit: chr "msl"
# No geometry
  • This site has the site manager’s name
  • but no boundary polygon

Second example, Gran Paradiso in Italy

paradiso <- get_ilter_generalinfo(country_name = "Italy",
                              site_name = "Gran Paradiso")
(paradiso$title)
## [1] "IT23 - Gran Paradiso National Park - Italy"
## [2] "Gran Paradiso National Park - Italy"
# Choose the second
paradiso_id <- paradiso[2,]$uri
paradiso_details <- get_site_info(paradiso_id,"Contacts")
# Multiple names for metadata:
paradiso_details$generalInfo.metadataProvider[[1]]['name']
##                 name
## 1 Alessandro Oggioni
## 2     Ramona Viterbi

# But what about funding agency
paradiso_details$generalInfo.fundingAgency
## [1] NA
  • This site has metadata providers
  • but no funding agency

Acquiring Earth Observation data

Functions within ReLTER help to acquire certain Earth Observation datasets. The get_site_ODS() function offers to ReLTER users access to the OpenDataScience Europe (ODS) archive (https://maps.opendatascience.eu/) with landcover, NDVI, natura2000, Corine landcover, and OSM features, all at 30 meter pixel resolution. Cropping to site boundaries is done in the cloud, and due to the Cloud Optimized Geotiff (COG) format, downloads are quite small.

First example, Kis-Balaton site in Kiskun region, Hungary

# Get DEIMS ID for Kis-Balaton site 
kis_balaton <- get_ilter_generalinfo(country_name = "Hungary",
                              site_name = "Kis-Balaton")
kb_id = kis_balaton$uri
kb_polygon = get_site_info(kb_id, "Boundaries")

# Now acquire landcover and NDVI from ODS
kb_landcover = get_site_ODS(kb_id, dataset = "landcover")
kb_ndvi_summer = get_site_ODS(kb_id, "ndvi_summer")

# Plot maps
tm_basemap("OpenStreetMap.Mapnik") + 
  tm_shape(kb_polygon) +
  tm_borders(col = "purple") + 
  tm_shape(kb_ndvi_summer) +
  tm_raster(alpha=0.7, palette = "RdYlGn")

tm_basemap("OpenStreetMap.Mapnik") + 
  tm_shape(kb_polygon) +
  tm_borders(col = "purple") + 
  tm_shape(kb_landcover) +
  tm_raster(alpha=0.7, palette = "Set1")

Second example, Companhia das Lezírias, Portugal

lezirias <- get_ilter_generalinfo(country_name = "Portugal",
                              site_name = "Companhia")
lezirias_id = lezirias$uri
lezirias_polygon = get_site_info(lezirias_id, "Boundaries")

# Now acquire spring NDVI from OSD
lezirias_ndvi_spring = get_site_ODS(lezirias_id, "ndvi_spring")

# Plot maps
tm_basemap("OpenStreetMap.Mapnik") + 
  tm_shape(lezirias_polygon) +
  tm_borders(col = "purple") + 
  tm_shape(lezirias_ndvi_spring) +
  tm_raster(alpha=0.7, palette = "RdYlGn")
# The function outputs a raster. We can save to Geotiff for use in other GIS
class(lezirias_ndvi_spring)
## [1] "SpatRaster"
## attr(,"package")
## [1] "terra"
writeRaster(x = lezirias_ndvi_spring,
            filename = "lezirias_ndvi_spring.tif",
            overwrite = TRUE)

Additional plotting functions

Environmental parameters

ReLTER has implemented some revealing visualizations of the various parameters collected at LTER sites. One visualization is the pie chart of environmental parameters.

In an example above the DEIMS ID of Kis Balaton (Kiskun LTER) was found. We’ll use that site to show a pie chart of environmental variables collected in that site.

produce_site_parameters_pie(kb_id)

## # A tibble: 8 × 9
##   parameterGroups            n   freq label   end start middle hjust vjust
##   <chr>                  <int>  <dbl> <chr> <dbl> <dbl>  <dbl> <dbl> <dbl>
## 1 agricultural parameter     1 0.0208 2%    0.131 0     0.0654     0     0
## 2 atmospheric parameter      1 0.0208 2%    0.262 0.131 0.196      0     0
## 3 biological parameter      16 0.333  33%   2.36  0.262 1.31       0     0
## 4 chemical parameter        16 0.333  33%   4.45  2.36  3.40       1     1
## 5 ecosystem parameter        8 0.167  17%   5.50  4.45  4.97       1     0
## 6 physical parameter         1 0.0208 2%    5.63  5.50  5.56       1     0
## 7 soil parameter             1 0.0208 2%    5.76  5.63  5.69       1     0
## 8 water parameter            4 0.0833 8%    6.28  5.76  6.02       1     0

Similarly, a “waffle” chart can be produced.

produce_site_parameters_waffle(kb_id)

## # A tibble: 8 × 4
##   parameterGroups            n   freq label
##   <chr>                  <int>  <dbl> <chr>
## 1 agricultural parameter     1 0.0208 2%   
## 2 atmospheric parameter      1 0.0208 2%   
## 3 biological parameter      16 0.333  33%  
## 4 chemical parameter        16 0.333  33%  
## 5 ecosystem parameter        8 0.167  17%  
## 6 physical parameter         1 0.0208 2%   
## 7 soil parameter             1 0.0208 2%   
## 8 water parameter            4 0.0833 8%

Show a chaining of several functions

This example uses the LTER network in Greece. Call the produce_network_points_map() function (requires both DEIMS network ID and the three letter ISO code for the country to be mapped) to get all sites in a country.

lter_greece_id = "https://deims.org/networks/83453a6c-792d-4549-9dbb-c17ced2e0cc3"
lter_greece <- produce_network_points_map(lter_greece_id, "GRC")
grc <- readRDS("gadm36_GRC_0_sp.rds")  # available from `produce_network_points_map()

tm_basemap("OpenStreetMap.Mapnik") + 
  tm_shape(lter_greece) + 
  tm_dots(col = "blue", size=0.08) +
  tm_shape(grc) + 
  tm_borders(col = "purple", lwd=2) +
  tm_grid(alpha = 0.4) +
  tm_scale_bar(position = c("right", "bottom"))